USE [$(targetDatabaseName)]
GO

DECLARE @userName VARCHAR(128)
DECLARE @sqlCmd NVARCHAR(4000)

DECLARE databaseUsers CURSOR FAST_FORWARD FOR
SELECT name 
FROM sys.sysusers 
WHERE name NOT IN ('dbo','guest','sys','INFORMATION_SCHEMA') AND 
	issqlrole = 0

OPEN databaseUsers

FETCH NEXT FROM databaseUsers INTO @userName

WHILE @@FETCH_STATUS = 0
BEGIN
	PRINT 'Dropping ' + @userName

	SET @sqlCmd = 'DROP USER ' + quotename(@userName)
	EXEC sp_executesql @sqlCmd
	FETCH NEXT FROM databaseUsers INTO @userName
END

CLOSE databaseUsers
DEALLOCATE databaseUsers